import http from '../httpRequest';

class groupMemberApi {}

// 查询群聊列表
groupMemberApi.prototype.findgroupList = function() {
	return http({
		url: '/group/list',
		method: 'GET'
	})
}
// 修改群聊人员设置
groupMemberApi.prototype.updateMemberInfo = function(data) {
	return http({
		url: '/group/updateMember',
		method: 'PUT',
		data:data
	})
}
// 查询群聊
groupMemberApi.prototype.findgroup = function(data) {
	return http({
		url: `/group/find?groupId=` + data,
		method: 'GET',
	})
}
// 邀请进群
groupMemberApi.prototype.groupinvite = function(data) {
	return http({
		url: '/group/invite',
		method: 'PUT',
		data
	})
}
// 查询群聊成员
groupMemberApi.prototype.findgroupMember = function(data) {
	return http({
		url: `/group/members?groupId=` + data,
		method: 'GET',
	})
}
// 退出群聊
groupMemberApi.prototype.quitGroup = function(data) {
	return http({
		url: `/group/quit?groupId=` + data,
		method: 'DELETE',
	})
}
//踢出群聊
groupMemberApi.prototype.kickGroup = function(groupId, userId) {
	return http({
		url: `/im/group/kick?groupId=` + groupId + '&userId=' + userId,
		method: 'DELETE',
	})
}
//群详情
groupMemberApi.prototype.getGroupInfo = function(data) {
	return http({
		url: `/group/getGroupInfo?id=` + data,
		method: 'GET',
	})
}
//修改是否禁言
groupMemberApi.prototype.updateProhibitSpeak = function(data) {
	return http({
		url: `/group/prohibitSpeak`,
		method: 'POST',
		data:data
	})
}
//修改是否群管理员
groupMemberApi.prototype.updateIsAdmin = function(data) {
	return http({
		url: `/group/updategly`,
		method: 'PUT',
		data:data
	})
}
//获取权限
groupMemberApi.prototype.getPermission = function(data) {
	return http({
		url: `/im/group-member/getPermission1`,
		method: 'POST',
		data:data
	})
}
//获取群聊成员-分页
groupMemberApi.prototype.getGroupMemberPage = function(data) {
	return http({
		url: `/group/members/page`,
		method: 'get',
		data:data
	})
}

export default groupMemberApi;
